//layui弹窗组件
export default {
  //普通消息
  info(msg, time = 3000) {
    layer.msg(msg, { time: time });
  },
  //成功
  success(msg, time = 3000) {
    layer.msg(msg, { time: time, icon: 1 });
  },
  //失败
  err(msg, time = 3000) {
    layer.msg(msg, { time: time, icon: 2 });
  },
  //疑问
  doubt(msg, time = 3000) {
    layer.msg(msg, { time: time, icon: 3 });
  },
  //哭脸
  cry(msg, time = 3000) {
    layer.msg(msg, { time: time, icon: 5 });
  },
  //笑脸
  laugh(msg, time = 3000) {
    layer.msg(msg, { time: time, icon: 6 });
  },
  //警告
  warning(msg, time = 3000) {
    layer.msg(msg, { time: time, icon: 7 });
  },

  //loading
  loading(type = 1) {
    return layer.load(type);
  },
  //关闭指定弹窗
  close(id) {
    layer.close(id);
  },
  //关闭所有弹窗
  closeAll() {
    layer.closeAll();
  },
};
